﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace FeedAntGame.Sprite.Event
{
    
    abstract class  EventBaseSprite : BaseSprite
    {
        public enum STATE_TYPE { CLICK, HOVER, NORMAL, DISABLE}

        protected STATE_TYPE _state  = STATE_TYPE.NORMAL;
        protected bool _enable  = true;
        
        /************************************************************************/
        /*                      Get/Set                                                                     */
        /************************************************************************/
        public virtual STATE_TYPE State { get; set; }
        
        
        /// <summary>
        /// If use Enable, State must have at least NORMAL and DISABLE.
        /// </summary>
        public bool Enable 
        {
            get
            {
                return _enable;
            }
            set
            {
                _enable = value;
                if (_enable)
                {
                    if (_state == STATE_TYPE.DISABLE)
                    {
                        State = STATE_TYPE.NORMAL;
                    }
                }
                else
                {
                    State = STATE_TYPE.DISABLE;
                }
            }
        }

        public override Vector2 Direction
        {
            get { return speed; }
        }

        
        /************************************************************************/
        /*                      Constructor                                                                     */
        /************************************************************************/
        public EventBaseSprite( Vector2 position, Point frameSize,
            int collisionOffset, Point sheetSize, Vector2 speed, string collisionCueName, float scale)
            : base(null, position, frameSize, collisionOffset, Point.Zero,
            sheetSize, speed, collisionCueName, 0, scale)
        {
            
        }


        /************************************************************************/
        /*                      Functions                                                                     */
        /************************************************************************/
        public override void Update(GameTime gameTime, Rectangle clientBounds)
        {

            base.Update(gameTime, clientBounds);
        }
        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            if(textureImage!=null)
                base.Draw(gameTime, spriteBatch);            
        }
    }
}
